<template>
  <div class="common-layout">
    <el-container>
      <el-header></el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu router :default-active="defaultActive">
            <el-menu-item index="/home">个人信息</el-menu-item>
            <el-menu-item index="/insurances">保单列表</el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts" setup>
import { useRoute } from 'vue-router';

const route = useRoute();
const defaultActive = route.path;
</script>

<style lang="scss" scoped>
.common-layout {
  > .el-container {
    > .el-header {
      background-color: var(--el-color-primary);
    }
  }
}
</style>
